using UnityEngine;
using System.Collections;

public class Key : MonoBehaviour {

    private GameObject portal;
    private Portal portalScript;
	
    void Start () {
        portal = GameObject.FindGameObjectWithTag("Portal");
        portalScript = portal.GetComponent<Portal>();
	}
	
	void Update () {
	
	}

    void OnTriggerEnter(Collider collider)
    {
        if (collider.tag.Equals(Tags.player))
        {
            gameObject.SetActive(false);
            portalScript.TookKey = true;
        }
    }
}